<template>
  <div>
    <h1>App</h1>

    <Hello ref="myHello" />

    <button @click="fn1">获取标记的内容</button>

    <hr />
    <World ref="myWorld" />
    <button @click="fn2">获取 World 的实例对象</button>
  </div>
</template>

<script>
import Hello from './components/Hello.vue';
import World from './components/World.vue';

export default {
  components: {
    Hello,
    World
  },
  methods: {
    fn1() {
      console.log(this.$refs.myHello)
    },
    fn2() {
      console.log('this.$refs.myWorld', this.$refs.myWorld)
    }
  },
}
</script>